const express = require("express");
// 文章
const setUp = require("../middleware/setUp");
// 创建应用
const setUpApp = express();
// 获取网站数据
setUpApp.get("/getSetUp", [setUp.getSetUp], (req, res) => {
    res.send({
        code: 200,
        data:{...req.setUpData[0]}
    });
});
setUpApp.post("/updateSetUp", [setUp.updateSetUp], (req, res) => {
    if (req.data.affectedRows) {
        res.json({
            code: 200,
            msg: req.data.msg + '成功'
        });
    } else {
        res.json({
            code: 404,
            msg: req.data.msg + "失败",
        });
    }
});
module.exports = setUpApp;